﻿using System.Collections;
using System.Collections.Generic;
using ZSoftInstagram.Domain.Board;
using ZSoftInstagram.UI.ViewModels;

namespace System
{
    public static class PinExtensions
    {
        public static IEnumerable<PinViewModel> ToPinViewModel(this ICollection<ImagePin> source)
        {
            var result = new List<PinViewModel>();
            foreach (var item in source)
            {
                result.Add(new PinViewModel()
                {
                    Id = item.Id,
                    Address = new AddressViewModel() { Path = item.Address.Path, AddressType = item.Address.AddresType }
                });
            }
            return result;
        }
    }
}
